home *** CD-ROM | disk | FTP | other *** search
/ Experimental BBS Explossion 3 / Experimental BBS Explossion III.iso / comunic / twft099b.zip / 2RDR.TXT next >
Text File  |  1993-05-08  |  7KB  |  186 lines

  1. Edited version of a message by David Myers to Rick Cooney:
  2.  
  3.     I was worrying about trading algorithms this morning at work,
  4. especially with regard to the 5 point method described in TWTIPS.
  5. There are 2 assumptions made, which can be described as follows:
  6.  
  7. 1) That the best price does not fluctuate except in units of your
  8.    ship holds. (I can't test this yet).
  9.  
  10. 2) That DIFF, the difference between the best price and our
  11.    best price estimate, differs by a fraction x diff, the difference
  12.    between consecutive offers by the port.  This is a kind of
  13.    linear difference model, that can be described by the
  14.    equation
  15.  
  16.    DIFF = f*diff.
  17.  
  18.    Now in general any well-behaved function describing DIFF can be
  19.    expressed in terms of diff by a series expansion of the form 
  20.    (this is a Taylor series expansion for those of you who 
  21.     follow the calculus):
  22.  
  23.    DIFF = f*diff + g*diff^2 + h*diff^3 + ...
  24.  
  25.    So assertion (2) amounts to suggesting that g, h, and all higher
  26.    terms can be ignored.  This turns out to be testable. 
  27.    ----------------------------------------------------------------
  28.    A port in which g, h, and higher terms can be ignored is called
  29.    a linear port.
  30.    ----------------------------------------------------------------
  31.  
  32.    HOW DO YOU TEST THE LINEARITY HYPOTHESIS ???
  33.  
  34.    1. Overestimate the best price.
  35.  
  36.    2. Estimate new prices by the formula
  37.  
  38.       NEWOFFER = OLDOFFER - factor*diff
  39.  
  40.      make factor a small number and don't vary it. 1.5 should work.
  41.  
  42.      what you will end up with are a series of port offers and counter
  43.      bids by us:
  44.  
  45. PORT:            orig_offer
  46.   US:            bid 1
  47. PORT:            offer2
  48.   US:            bid 2
  49. PORT:            offer3
  50.   US:           bid 3
  51. PORT:            offer4
  52.             
  53.      let diff  = offer2 - orig_offer
  54.          diff2 = offer3 - offer2
  55.          diff3 = offer4 - offer3
  56.  
  57.      now in the linear difference model, factor is related to f
  58.      by the equation factor = (1/f - 1).  So, the "optimal"
  59.      5 point f value of 0.3 translates into a factor of 2.33333333 etc.
  60.  
  61.      So our chosen factor leads to an estimate of the best f, which
  62.      we will call f(est)..
  63.  
  64.      however.. 
  65.  
  66.      diff2/diff = f(est) - f, so f = diff2/diff + f(est).
  67.  
  68.      In other words, if we know the f(est) value we used in our
  69.      second bid, the differences between a trio of consecutive 
  70.      port offers nails f, *IF* the linear difference model is
  71.      correct.  It also allows exact calculation of margins, which
  72.      leads to the possibility that you get more trading information
  73.      by initially overestimating the port price, and underestimating
  74.      factor, than by relying on the Psychic Probe.
  75.  
  76.      WHEN IS THE LINEAR DIFFERENCE MODEL CORRECT?
  77.  
  78.      The LDM is true if and only if diff3/diff2 = diff2/diff.
  79.    
  80.      David Myers.   
  81.  
  82.  
  83. Edited version of a letter from David Myers to Steve Whitis:
  84.  
  85. Eugene Hung left Tradewars with a legacy of rules for getting at the
  86. 5 point price of a port.  Unfortunately, in my mind, he also left as
  87. many questions as answers.  
  88.  
  89. Q:Why is it that his rules fail on certain ports?
  90.  
  91. Q:Why do you have to modify the psychic probe price to get some 5
  92. point pricing to work, or in other words, why does a psychic probe 
  93. lie?
  94.  
  95. Q:Why is it that the difference between the first port offer and
  96.   the second port offer follows the rule :
  97.   abs(first-second) = 0.3*abs(best possible port price - our best
  98.   estimate)?
  99.  
  100. The answer to the first question is that Hung's rules aren't complete
  101. and cannot be used as an exact description of all ports.  The take-home 
  102. lesson of the second question is that blind reliance on the psychic
  103. probe to obtain all your information about the port and pricing is,
  104. in essence, handing your confidence over to a liar (unless of
  105. course, someone comes up with a rule for determining the nature and
  106. extent of the lie).  But the answer to the third question is that this
  107. proposition can be tested.  It leads to the question that currently
  108. consumes me, i.e. whether it is possible to describe accurately the
  109. trading practices of a single product at a single port in a 
  110. relatively short number of observations.  Can this be done in general
  111. for any trading game?  How do we go about finding this kind of
  112. information?  
  113.  
  114. As best I can determine (and I don't claim to know everything yet),
  115. the secret to getting a port to divulge as many secrets as you
  116. can is by OVERBIDDING.  If the port is a linear port (I won't get into
  117. that here, suffice it to say a "true" 5 point port is a linear port),
  118. ----------------------------------------------------------------------
  119. Editing note: Actually, a "true" 5 point port isn't a "true" linear
  120. port because of stochastic elements in its initial offer and the
  121. need to "quantize" the offers in order to get at the true best value
  122. of the port.  In a sense a 5 point port is an extension of a
  123. linear port but can't be thought of as one in the strict sense of
  124. the term.
  125. ----------------------------------------------------------------------
  126. then the overbid can be corrected with the formula (when selling a
  127. product):
  128.  
  129. NEW BID = FIRST BID - FACTOR*(OFFER2 - OFFER)
  130.  
  131. Where New Bid is your second bid, First Bid is your first offer to
  132. the port, Offer2 is the port's second offer, and Offer is the ports
  133. original offer.  FACTOR turns out to be related to that number 0.3
  134. by the formula (assuming 0.3 to be true)
  135.  
  136.         FACTOR = 1/0.3 - 1 = 2.3333333333
  137.  
  138. But since we aren't assuming 0.3 is true, we'll call the element in
  139. the denominator f and we then have the formula
  140.  
  141.         FACTOR = 1/f - 1
  142.  
  143. So lets go to the example.  We will estimate a margin of 10%, i.e. we
  144. will multiply the first offer by a 10% margin to get our first bid.
  145. We will estimate FACTOR to be 2.
  146.  
  147.                  Offer      10,000
  148.                  Our Bid    11,000
  149.                  Offer2     10,150
  150.                  Bid 2      10,700
  151.                  Offer3     10,160
  152.  
  153. Now, the fact that the port made a third offer means that
  154.  
  155. (a) margin is in error, and
  156. (b) FACTOR (and thus f) is in error.
  157.  
  158. If the factor f is known to precision, and the linear model true, you
  159. should never see a third bid.  So what is the error in f?
  160.  
  161. Our estimate of f is 1/(factor + 1) = one third.  The difference in
  162. price between the third offer and the second offer is 10, the difference
  163. between the second offer and the first offer is 150. 10/150 = 1/15.
  164.  
  165. To correct f:  f(actual) = f(est) - 10/150 = 0.3333 - 0.0666 = 0.2667
  166.  
  167. To correct margin:
  168.  
  169.               new margin = (Our Bid - 150/f) Offer =
  170.                             (11,000 - 438)/10,000 = 1.0562
  171.  
  172. This, at least, is a step toward the idea of modeling all price behavior
  173. of all ports, and provides more information than just a psychic probe
  174. report.
  175.  
  176. David.
  177.  
  178. Final note: The program TWFT is designed to allow tests of the above
  179. hypotheses.  The trade algorithm has an implementation of second order
  180. corrections to FACTOR via a variety of methods.  You can SET factor
  181. in the program through the F10 command.  If you have time and a quiet
  182. game to try this in, I'd set factor to different values and see if
  183. it converges to a certain range of values.  That would give you a 
  184. functional definition of what values factor must be in order to be 
  185. effective.
  186.